#pragma once
#ifndef _KLAS_GL_RENDER_TO_TEXTURE_HPP_
#define _KLAS_GL_RENDER_TO_TEXTURE_HPP_

#include "../RenderToTexture.hpp"
#include "../../GLLibs.hpp"

namespace klas
{
  namespace graphics
  {
    namespace gl
    {
      class GLRenderToTexture: public RenderToTexture, public library::Gl
      {
      public:
        GLRenderToTexture(const math::Vector2<uint32>& dim, uint32 bpp=32);
        virtual ~GLRenderToTexture();

        virtual void init(const math::Vector2<uint32>& dim, uint32 bpp=32);
        virtual void kill();

        virtual void enable();
        virtual void disable();

        virtual void render(const math::Vector2d& numSides, decimal alpha = 1.0f);

      private:
        GLuint m_fboID, m_textureID;
        math::Vector2<uint32> m_dim;
      };
    }
  }
}

#endif